package maldade.persistence.service;

import maldade.persistence.configuration.PersistenceConfiguration;

/**
 * Persistence service factory.
 * 
 * @author rNojiri
 */
public class PersistenceServiceFactory
{
	private static PersistenceService persistenceService = null;

	/**
	 * Constructs this factory.
	 */
	private PersistenceServiceFactory()
	{
		super();
	}

	/**
	 * REturns the persistence service instance.
	 * 
	 * @return PersistenceService
	 */
	public static PersistenceService getPersistenceService()
	{
		if (persistenceService == null)
		{
			persistenceService = new PersistenceService(
					PersistenceConfiguration.getSessionFactory());
		}

		return persistenceService;
	}
}
